import request from '@/utils/request'



export function confirmAppointment(appointmentId) {
  return request({
    url: '/appointment/appointment/confirmAppointment/' + appointmentId,
    method: 'get',
  })
}



// 根据教员姓名查询预约列表
export function getListByTeacherName(teacherName, status) {
  return request({
    url: `/appointment/appointment/getListByTeacherName/${teacherName}`,
    method: 'get',
    params: { status } // 添加状态参数
  })
}

// 根据家长姓名查询预约列表
export function getListByParentName(parentName, status) {
  return request({
    url: `/appointment/appointment/getListByParentName/${parentName}`,
    method: 'get',
    params: { status } // 添加状态参数
  })
}
// 查询我的预约列表（管理员查看所有）
export function listAppointment(query) {
  return request({
    url: '/appointment/appointment/list',
    method: 'get',
    params: query
  })
}

// 查询我的预约详细
export function getAppointment(appointmentId) {
  return request({
    url: '/appointment/appointment/' + appointmentId,
    method: 'get'
  })
}

// 新增我的预约
export function addAppointment(data) {
  return request({
    url: '/appointment/appointment',
    method: 'post',
    data: data
  })
}

// 修改我的预约
export function updateAppointment(data) {
  return request({
    url: '/appointment/appointment',
    method: 'put',
    data: data
  })
}

// 删除我的预约
export function delAppointment(appointmentId) {
  return request({
    url: '/appointment/appointment/' + appointmentId,
    method: 'delete'
  })
}
